<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ApplicationHelper</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            <span class="type">Module</span>
            ApplicationHelper
            
        </h1>
        <ul class="files">
            
            <li><a href="../files/app/helpers/application_helper_rb.html">app/helpers/application_helper.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>F</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-flash_class">flash_class</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-include_javascript_by_namespace">include_javascript_by_namespace</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>L</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-link_stylesheet_by_namespace">link_stylesheet_by_namespace</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>M</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="#method-i-method_use_time">method_use_time</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
        
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-flash_class">
            
              <b>flash_class</b>(level)
            
            <a href="../classes/ApplicationHelper.html#method-i-flash_class" name="method-i-flash_class" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-flash_class_source')" id="l_method-i-flash_class_source">show</a>
                
              </p>
              <div id="method-i-flash_class_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 20</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">flash_class</span>(<span class="ruby-identifier">level</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">level</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:notice</span> <span class="ruby-keyword">then</span> <span class="ruby-string">&quot;alert alert-info&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:success</span> <span class="ruby-keyword">then</span> <span class="ruby-string">&quot;alert alert-success&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:error</span> <span class="ruby-keyword">then</span> <span class="ruby-string">&quot;alert alert-error&quot;</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:alert</span> <span class="ruby-keyword">then</span> <span class="ruby-string">&quot;alert alert-error&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-include_javascript_by_namespace">
            
              <b>include_javascript_by_namespace</b>()
            
            <a href="../classes/ApplicationHelper.html#method-i-include_javascript_by_namespace" name="method-i-include_javascript_by_namespace" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-include_javascript_by_namespace_source')" id="l_method-i-include_javascript_by_namespace_source">show</a>
                
              </p>
              <div id="method-i-include_javascript_by_namespace_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 2</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">include_javascript_by_namespace</span>
  <span class="ruby-identifier">namespace</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:controller</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;/&#39;</span>)[<span class="ruby-number">0</span>]
  <span class="ruby-keyword">if</span> [<span class="ruby-string">&quot;ruiqu&quot;</span>, <span class="ruby-string">&quot;ems&quot;</span>, <span class="ruby-string">&quot;settings&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">namespace</span>)
    <span class="ruby-identifier">content_for</span> <span class="ruby-value">:pre_assets</span> <span class="ruby-keyword">do</span>
      <span class="ruby-identifier">javascript_include_tag</span> <span class="ruby-identifier">namespace</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-link_stylesheet_by_namespace">
            
              <b>link_stylesheet_by_namespace</b>()
            
            <a href="../classes/ApplicationHelper.html#method-i-link_stylesheet_by_namespace" name="method-i-link_stylesheet_by_namespace" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-link_stylesheet_by_namespace_source')" id="l_method-i-link_stylesheet_by_namespace_source">show</a>
                
              </p>
              <div id="method-i-link_stylesheet_by_namespace_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">link_stylesheet_by_namespace</span>
  <span class="ruby-identifier">namespace</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:controller</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;/&#39;</span>)[<span class="ruby-number">0</span>]
  <span class="ruby-keyword">if</span> [<span class="ruby-string">&quot;ems&quot;</span>, <span class="ruby-string">&quot;ruiqu&quot;</span>, <span class="ruby-string">&quot;settings&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">namespace</span>)
    <span class="ruby-identifier">content_for</span> <span class="ruby-value">:pre_assets</span> <span class="ruby-keyword">do</span>
      <span class="ruby-identifier">stylesheet_link_tag</span> <span class="ruby-identifier">namespace</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-method_use_time">
            
              <b>method_use_time</b>(&amp;block)
            
            <a href="../classes/ApplicationHelper.html#method-i-method_use_time" name="method-i-method_use_time" class="permalink">Link</a>
          </div>

          
            <div class="description">
              
            </div>
          

          

          

          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source:
                <a href="javascript:toggleSource('method-i-method_use_time_source')" id="l_method-i-method_use_time_source">show</a>
                
              </p>
              <div id="method-i-method_use_time_source" class="dyn-source">
                <pre><span class="ruby-comment"># File app/helpers/application_helper.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">method_use_time</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">puts</span> <span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">measure</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-comment"># s.orders.select(:store_customer_id).uniq.pluck(:store_customer_id)</span>
  <span class="ruby-comment"># s.orders.map(&amp;:store_customer_id).uniq</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>
